package com.example.sprintboot.dto;

/**
 * 分类查询DTO
 */
public class CategoryQueryDto {
    private Integer id;
    private String name;
    private Integer pageNum = 1;
    private Integer pageSize = 4;

    public CategoryQueryDto() {}

    public CategoryQueryDto(Integer id) {
        this.id = id;
    }

    public CategoryQueryDto(String name, Integer pageNum, Integer pageSize) {
        this.name = name;
        this.pageNum = pageNum != null ? pageNum : 1;
        this.pageSize = pageSize != null ? pageSize : 4;
    }

    // Getters and Setters
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum != null ? pageNum : 1;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize != null ? pageSize : 4;
    }
}
